
<html>
	<head>
		<style type="text/css">
			table.gradienttable {font-family: verdana,arial,sans-serif;border-width: 3px;border-collapse: collapse;}
			table.gradienttable th {padding: 3px;color:#FFFFFF;background: #000066;font-size:16px;}
			table.gradienttable td {padding: 3px;color:#000000;font-size:14px;background: #ebecda;text-align:center;}
			table.gradienttable th p{margin:3px;padding:9px;}
			table.gradienttable td p{padding:9px;}
			body {
				font-size: 16px; /* 设置默认字号 */
			}
			
		</style>

		<script>
		    function openhome() {
		        // 获取日期选择控件的值
		        var date = document.getElementById('mydate').value;

		        // 构建目标URL
		        var url = '/task/home';

		        // 打开新窗口
		        window.open(url, '_blank');
		    }
		</script>
	</head>
<body>
<div>
	
    <style>
        /* 标签页样式 */
        .mainmanue {
            overflow: hidden;
            border: 1px solid #ccc;
            background-color: #f1f1f1;
            text-align: center;
        }
    
        .mainmanue button {
            background-color: inherit;
            float: left;
            border: none;
            outline: none;
            cursor: pointer;
            padding: 14px 16px;
            transition: 0.3s;
        }
    
        .mainmanue button:hover {
            background-color: #ddd;
        }
    
        .mainmanue button.active {
            background-color: #ccc;
        }
    
        .tabcontent {
            display: none;
            padding: 6px 12px;
            border: 1px solid #ccc;
            border-top: none;
        }
    </style>
    <div class="mainmanue" >
        <button class="tablinks" onclick="window.location.href='/task/home'">个人按日任务清单</button>
        <button class="tablinks" onclick="window.location.href='/task/weeksummary'">周任务统计(旧-实时查询)</button>
        <button class="tablinks" onclick="window.location.href='/devreport/list'">周任务统计(新-单据)</button>
        <button class="tablinks" onclick="window.location.href='/story/home'">需求统计</button>
    </div>
	<div style="width:1600px;text-align:left;margin-left:auto;margin-right:auto;">
		#set(count_feishu_totalhour=0.0)
		#set(count_tapd_totalhour=0.0)
		#set(feishumancnt=0)
		#set(tapdmancnt=0)
		#set(feishuexpecttotalhour=0)
		#set(tapdexpecttotalhour=0)
		<div>
			<h1 style="text-align:center;">周工时统计 周应产出工时:#(totalHour)</h1>
			<table class="gradienttable" border="1" style="width:100%;line-height:2em;">
				<tr>
					<th>&nbsp;</th>
					#for(d : dates)
						<th>#date(d,"MM-dd EEEE")</th>
					#end
					<th>飞书总工时h</th>
					<th>飞书效率%</th>
					<th>TAPD总工时h</th>
					<th>TAPD效率%</th>
				</tr>
				#for(man:mans)
					<tr>
						<td>#(man.xName)</td>
						#set(feishutotalhour=0.0)
						#set(feishurate=0.0)
						#set(tapdtotalhour=0.0)
						#set(tapdrate=0.0)
						#set(countrate=0.0)
						#for(d : dates)
							<td>
								#for(data : datas)
									#if(data.xDate==d)
										#if(data.xMan==man.xName)
											#set(feishutotalhour=data.xFeishuTotalHour)
											#set(feishurate=data.xFeishuRate)
											#set(tapdtotalhour=data.xTapdTotalHour)
											#set(tapdrate=data.xTapdRate)
											#set(countrate=data.xCountRate)
											#if(data.xFeishuHour>0)
												#number(data.xFeishuHour,"0.#")
											#else
												&nbsp;
											#end
										#end
									#end
								#end

							</td>
						#end

						<td>#number(feishutotalhour,"0.#")</td>
						<td>#if(man.xIsCount??) 
								#number(feishutotalhour*100.0/(totalHour*countrate),"0")% 
								#set(feishuexpecttotalhour=feishuexpecttotalhour+totalHour*countrate)
								#set(count_feishu_totalhour=count_feishu_totalhour + feishutotalhour)
								#set(feishumancnt=feishumancnt+1)
							#else 
								- 
							#end
						</td>
						<td>#number(tapdtotalhour,"0.#")</td>
						<td>
							#if(man.xIsCountTapd??)
								#number(tapdtotalhour*100.0/(totalHour*countrate),"0")% 
								#set(tapdexpecttotalhour=tapdexpecttotalhour+totalHour*countrate)
								#set(count_tapd_totalhour=count_tapd_totalhour + tapdtotalhour)
								#set(tapdmancnt=tapdmancnt+1)
							#else
								-
							#end
						</td>

						
					</tr>
				#end

				<tr>
					<td>合计</td>
					#for(d : dates)
						<td>
							#for(data : datas)
								#set(todayhour=0.0)
								#set(todayTapdHour=0.0)
								#for(data : datas)
									#if(data.xDate==d)
										#set(m=data.xMan)
										#set(countfeishu=false)
										#set(counttapd=false)
										#for(x:mans)
											#if(x.xName==m)
												#set(countfeishu=data.xIsCount??)
												#set(counttapd=data.xIsCountTapd??)
											#end
										#end
										#set(todayhour=todayhour+data.xFeishuHour)
										#set(todayTapdHour=todayTapdHour+data.xTapdHour)
										
										
									#end
								#end
							#end
							#if(todayhour>0.0)
								#number(todayhour,"0.#")
							#else
								&nbsp;
							#end

						</td>
					#end

					#if(feishuexpecttotalhour>0) #set(count_feishu_rate=count_feishu_totalhour*100.0/feishuexpecttotalhour) #else #set(count_feishu_rate=0.0) #end
					#if(tapdexpecttotalhour>0) #set(count_tapd_rate=count_tapd_totalhour*100.0/tapdexpecttotalhour) #else #set(count_tapd_rate=0.0) #end
					
					<td>#number(count_feishu_totalhour,"0.#")</td>
					<td>#number(count_feishu_rate,"0")%</td>
					<td>#number(count_tapd_totalhour,"0.#")</td>
					<td>#number(count_tapd_rate,"0")%</td>
				</tr>
			<table>
			<br>
			<div>
				飞书统计人数:#(feishumancnt)
				, 飞书本周总工时:#number(count_feishu_totalhour,"0.#")
				,平均效率:#number(count_feishu_rate,"0")% 
				; 飞书统计人数:#(tapdmancnt)
				, TAPD本周总工时:#number(count_tapd_totalhour,"0.#")
				,平均效率:#number(count_tapd_rate,"0")% 
			</div>
		<div>
		<div style="text-align:right;font-size:2em;">
			<form action="/task/weeksummary" method="get" style="text-align:left;">
			    <label for="weekHours">本周应产出工时:</label>
			    <input type="number" step="any" id="totalHour" name="totalHour" required value="#(totalHour)" style="height:3em;">
			    
			    <label for="date">选择日期:</label>
			    <input type="date" id="mydate" name="date" value="" required style="height:3em;">
			    
			    <button type="submit" style="height:3em;width:5em;">查询</button>&nbsp;
				<button type="button" style="height:3em;width:5em;" onclick="window.open('/task/home','_blank')">个人</button>
			</form>

			<script>
			    // 设置日期输入框的默认值为当天日期
			    document.getElementById('mydate').value = '#date(date,"yyyy-MM-dd")';
			</script>
		</div>
	</div>
	<div>
		
		<div style="height:5em;"></div>
		#include("/task/weeksummary_bycusthours.html")
		
		<div style="height:5em;"></div>
		#include("/task/weeksummary_alltasks.html")
		
		<div style="height:5em;"></div>
		#include("/task/weeksummary_emergencys.html")

	</div>
</div>
</body>
</html>
		